
package com.studiofortress.sf.audio;

/**
 * This is an interface for describing a buffer where data can be stored and
 * read from.
 * 
 * @author Joseph Lenton - JosephLenton@StudioFortress.com
 */
interface AudioBuffer
{
    public void addBuffer(byte[] audio);
    public void addBuffer(byte[] audio, int audioLength);
    public byte[] getBuffer(final int start, final int length);

    public byte getByte(final int location);
    
    /**
     * @return The number of bytes stored in this buffer.
     */
    public int size();

    /**
     * Compacts down the internal buffer so that it fits into only the number of
     * bytes used.
     */
    public void finish();
    
    /**
     * @return True if this buffer is finished with and no more data will be added to it.
     */
    public boolean isFinished();
}
